<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="menu" content="assetMenu" />
<meta name="nav" content="1" />
<meta name="acc" content="0" />
<title>车辆管理</title>
<script>
		$(document).ready(function() {
		 $("input[id='buyTimeBefore']").addClass("Wate").bind("click", function(){
    	 WdatePicker({skin:'whyGreen',minDate:'1900-10-01',maxDate:'#F{$dp.$D(\'buyTimeEnd\')||\'%y-%M-%d\'}',dateFmt:'yyyy-MM-dd'});});
		 $("input[id='buyTimeEnd']").addClass("Wate").bind("focus", function(){
    	 WdatePicker({skin:'whyGreen',minDate:'#F{$dp.$D(\'buyTimeBefore\')}',maxDate:'%y-%M-%d',dateFmt:'yyyy-MM-dd'});});
		});
		
		
		 function returnCar(){
				var checkedRadio = $("input[name='radio']:checked");
				var $carId = checkedRadio.val();
				var itemId = checkedRadio.attr("id");
				var count = itemId.substring(5,6);
				var $licenseplateNumber = $("#licenseplateNumber"+count).html();
				window.returnValue = {carId:$carId,choicecar:$licenseplateNumber};
				window.close();
		
		}
			
	</script>
</head>
<body>
<form id="mainForm" action="information!list.action" method="get" class="yform">
<div id="message"><s:actionmessage theme="custom"
	cssClass="success" /></div>
<div id="content">
<table id="contentTable">
	<tr>
		<th>选 择</th>
		<th>车牌号</th>
		<th>购入日期</th>
		<th>品牌</th>
		<th>车辆类型</th>
		<th>颜色</th>
		<th>驾驶员</th>
	</tr>
	<c:forEach items="${page.result}" var="carInformation" varStatus="var">
		<tr>
			<td>
			
				<input type="radio" name="radio" id="radio${var.count}"
				value="<c:out value='${carInformation.id}'/>" />
			
			</td>
			<td id="licenseplateNumber${var.count}">${carInformation.licenseplateNumber}</td>
			<td>${carInformation.buyDate}</td>
			<td>${carInformation.brand}</td>
			<td>${carInformation.carType}</td>
			<td>${carInformation.carColor}</td>
			<td>${carInformation.driver}</td>

		</tr>
	</c:forEach>
</table>
<input type="button" onclick="returnCar()" value="确定" /><input
	type="button" onclick="JavaScript:window.close();" value="关闭" /></div>
<jsp:include page="/common/page.jsp" />
</form>
</body>
</html>
